// Copyright (C) 2005 Taylor L. Riché <riche@cs.utexas.edu>
//  
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
// 
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
// 
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software 
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//
// 	$Id: FlowFunction.hh 85 2005-08-02 17:23:00Z richetl $	
//

#ifndef FLOWFUNCTION_H
#define FLOWFUNCTION_H

#include <list>
#include <map>

#ifdef LEE_BUILD
#include "PPFunction.hh"
#else
#include <lee/PPFunction.hh>
#endif

namespace lee {

  typedef unsigned long FlowID;
  typedef std::list<FlowID *> FlowList;
  typedef std::map<FlowID *, void *> FlowMap;
  
  enum FlowSig {FIVET, SRCDEST_IP, SRC_IP_PORT};

  class FlowFunction
  {
    FlowSig signature;
  protected:
    inline void setFlowSig(FlowSig f) {signature = f;}
    inline FlowSig getFlowSig() {return signature;}
    virtual FlowID getFlowID(PktData * p);
  public:
    FlowFunction();
    virtual ~FlowFunction() {}
    virtual void * getState(const FlowList & l) = 0;
    virtual void installState(const FlowMap & state) = 0;
  };
}

#endif // FLOWFUNCTION_H

